﻿using System;
using CoreRay.Collections;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CoreRay.Testing
{    
    /// <summary>
    /// This is a test class for BinaryTreeTest and is intended
    /// to contain all BinaryTreeTest Unit Tests.
    /// </summary>
    [TestClass]
    public class BinaryTreeTest
    {
        /// <summary>
        /// Constructor test.
        /// </summary>
        [TestMethod]
        public void ConstructorTest()
        {
            // Execute
            BinaryTree<GenericParameterHelper> testTree = new BinaryTree<GenericParameterHelper>();

            // Verify
            Assert.IsNull(testTree.Root);
        }

        /// <summary>
        /// Clear test.
        /// </summary>
        [TestMethod]
        public void ClearTest()
        {
            // Setup
            BinaryTreeNode<GenericParameterHelper> rootNode = new BinaryTreeNode<GenericParameterHelper>(new GenericParameterHelper());
            BinaryTree<GenericParameterHelper> testTree = new BinaryTree<GenericParameterHelper>();

            // Execute
            testTree.Root = rootNode;
            testTree.Clear();

            // Verify
            Assert.IsNull(testTree.Root);
        }
    }
}
